﻿using System.Windows;

namespace WpfApp2;

public partial class LoginWindow : Window
{
    public LoginWindow()
    {
        InitializeComponent();
    }
    
    
    private void Login_Click(object sender, RoutedEventArgs e)
    {
        string username = UsernameBox.Text;
        string password = PasswordBox.Password;

        // 简单示例，真实应用请用安全验证
        if (username == "123" && password == "123")
        {
            // 登录成功，打开 MainWindow
            MainWindow mainWindow = new MainWindow();
            mainWindow.Show();

            // 关闭登录窗口
            this.Close();
        }
        else
        {
            MessageBox.Show("用户名或密码错误！", "登录失败", MessageBoxButton.OK, MessageBoxImage.Warning);
        }
    }

    
    
}